package mutsumimod.powers;

import com.evacipated.cardcrawl.mod.stslib.powers.interfaces.NonStackablePower;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction;
import com.megacrit.cardcrawl.actions.common.ReducePowerAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.powers.TheBombPower;
import mutsumimod.MutsumiMod;

public class ForgetPower extends BasePower implements NonStackablePower {
    public static final String POWER_ID = MutsumiMod.makeID(ForgetPower.class.getSimpleName());

    public ForgetPower(AbstractCreature owner,int amount,int amount2) {
        super(POWER_ID, PowerType.DEBUFF, false, owner, amount);
        this.amount2 = amount2;
        updateDescription();
    }

    @Override
    public void atEndOfTurn(boolean isPlayer) {
        if (!AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
            this.addToBot(new ReducePowerAction(this.owner, this.owner, this, 1));
            if (this.amount == 1) {
                this.addToBot(new DamageAction(AbstractDungeon.player,new DamageInfo(
                        AbstractDungeon.player,amount2, DamageInfo.DamageType.HP_LOSS), AbstractGameAction.AttackEffect.FIRE));
            }
        }
    }

    @Override
    public void updateDescription() {
        this.description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[1]+amount2+DESCRIPTIONS[2];
    }

}
